﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.Generic;
using AbstraX.ClientInterfaces;
using System.ServiceModel.DomainServices.Client;
using System.Collections.ObjectModel;
using MvvmTreeView;

namespace TreeBuilder.Contracts
{
    public delegate void ChildrenLoadedHandler(ITreeNodeBase parent, EventArgs e);
    public delegate void NodeOperationSuccessful(ITreeNodeBase node, EventArgs e);
    public delegate void ImageNodeImageAvailableHandler(ITreeNodeBase node);

    public interface ITreeNodeBase
    {
        string Text { get; set; }
        void LoadChildren();
        IBase BaseObject { get; set; }
        ITreeNodeBase ReferenceNode { get; set; }
        ITreeNodeBase ShortcutNode { get; set; }
        float ChildOrdinal { get; set; }
        IEnumerable<ITreeNodeBase> Children { get; }
        ITreeNodeBase InternalNodeObject { get; }
        event ChildrenLoadedHandler ChildrenLoaded;
        void Remove();
        bool HasLayoverImage<T>(out T image);
    }

    public interface ITreeNodeServerEntity : IClonable<ITreeNodeServerEntity>
    {
        Entity ServerEntity { get; }
        string ID { get; }
        event NodeOperationSuccessful RemovedSuccessfully;
        event NodeOperationSuccessful UpdatedSuccessfully;
        void NoChildren();
    }
}
